﻿namespace ImageProcessing
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Domains;
    using MathWorks.MATLAB.NET.Arrays;
    using MathWorks.MATLAB.NET.Utility;
    using MATLABApp;
    using Test2;
    using Untitled1;

    /// <summary>
    /// Effects action
    /// </summary>
    public enum EffectsAction
    {
        /// <summary>
        /// arrows effects
        /// </summary>
        Arrows,

        /// <summary>
        /// Brush Effect
        /// </summary>
        Brush,

        /// <summary>
        /// Edges Effects
        /// </summary>
        Edges,

        /// <summary>
        /// objects effect
        /// </summary>
        Object,

        /// <summary>
        /// art effect
        /// </summary>
        Art,
    }

    /// <summary>
    /// SHAPENAME chocied shap enum
    /// </summary>
    public enum SHAPENAME
    {
        /// <summary>
        /// No shape.
        /// </summary>
        NONE,

        /// <summary>
        /// Rectangle Shape
        /// </summary>
        RECTANGLE,

        /// <summary>
        /// Ellipse shape
        /// </summary>
        ELLIPSE,

        /// <summary>
        /// Circle shape
        /// </summary>
        CIRCLE,

        /// <summary>
        /// Polygon shape
        /// </summary>
        POLYGON,

        /// <summary>
        /// FreeMove mode
        /// </summary>
        FreeMove
    }

    /// <summary>
    /// Editing Mode enum
    /// </summary>
    public enum EditingMode
    {
        /// <summary>
        /// Cropppign Mode
        /// </summary>
        Cropping,

        /// <summary>
        /// Rotating Mode 
        /// </summary>
        Rotating,

        /// <summary>
        /// Transleting Mode
        /// </summary>
        Translating,

        /// <summary>
        /// Subtractiong Mode
        /// </summary>
        Subtracting,

        /// <summary>
        /// Shearing mode
        /// </summary>
        Shearing,

        /// <summary>
        /// Resizing mode
        /// </summary>
        Resizing,

        /// <summary>
        /// Hand mode
        /// </summary>
        Hand,

        /// <summary>
        /// Hand mode
        /// </summary>
        Drawing,

        /// <summary>
        /// Do Nothing Mode
        /// </summary>
        Nothing
    }

    /// <summary>
    /// Cursor types or shapes enum
    /// </summary>
    public enum CursorType
    {
        /// <summary>
        /// Cross used in Selection or Zooming 
        /// </summary>
        Cross,

        /// <summary>
        /// Default shape
        /// </summary>
        Default
    }

    /// <summary>
    /// Editing mode enum
    /// </summary>
    public enum PicMode
    {
        /// <summary>
        /// Selecting region from the image mode 
        /// </summary>
        Select,

        /// <summary>
        /// Default mode
        /// </summary>
        Default,

        /// <summary>
        /// Translate Mode 
        /// </summary>
        Translate,

        /// <summary>
        /// Crop Mode
        /// </summary>
        Cropping
    }

    /// <summary>
    /// IlluminatiDonEnum for Illumination operation
    /// </summary>
    public enum InputValuesEnum
    {
        /// <summary>
        /// Gamma correction
        /// </summary>
        Gamma,

        /// <summary>
        /// histogram local eqlization
        /// </summary>
        HistogramLocal,

        /// <summary>
        /// mean filter 2D
        /// </summary>
        MeanFilter2D,

        /// <summary>
        /// mean filter 1D
        /// </summary>
        MeanFilter1D,

        /// <summary>
        /// Gaussian Filter 2D
        /// </summary>
        GaussianFilter2D,

        /// <summary>
        /// Gaussian Filter 1D
        /// </summary>
        GaussianFilter1D,

        /// <summary>
        /// Salt and pepper noise
        /// </summary>
        SaltAndPepperNoise,

        /// <summary>
        /// Gaussian noise
        /// </summary>
        GaussianNoise,

        /// <summary>
        /// Uniform Noise
        /// </summary>
        UniformNoise,

        /// <summary>
        /// Exponential Noise
        /// </summary>
        ExponentialNoise,

        /// <summary>
        /// Gamma Noise
        /// </summary>
        GammaNoise,

        /// <summary>
        /// Raleigh Noisee
        /// </summary>
        RaleighNoise,

        /// <summary>
        /// Noise filter
        /// </summary>
        NoiseFilter,

        /// <summary>
        /// Quantization bit
        /// </summary>
        Quantization,

        /// <summary>
        /// Resizing images
        /// </summary>
        Resizing,

        /// <summary>
        /// No thing
        /// </summary>
        Nothing
    }

    /// <summary>
    /// filters type
    /// </summary>
    public enum FilterType
    {
        /// <summary>
        /// minnumum Filter
        /// </summary>
        Min2D,

        /// <summary>
        /// Minimum filter 1D
        /// </summary>
        Min1D,

        /// <summary>
        /// maxmum Filter
        /// </summary>
        Max2D,

        /// <summary>
        /// Maximum filter 1D
        /// </summary>
        Max1D,

        /// <summary>
        /// MidPoint Filter
        /// </summary>
        MidPoint,

        /// <summary>
        /// median Filter
        /// </summary>
        Median,

        /// <summary>
        /// Arithmatic Mean Filter
        /// </summary>
        AriMean,

        /// <summary>
        /// Geometric Mean Filter
        /// </summary>
        GeoMean,

        /// <summary>
        /// Adaptive Mean Filter
        /// </summary>
        AdaptiveMean
    }

    /// <summary>
    /// Struct to carry image R G B
    /// </summary>
    public struct ImageStructure
    {
        /// <summary>
        /// Red, Green and Blue bytes
        /// </summary>
        public byte A, R, G, B;

        /// <summary>
        /// Implements the operator -.
        /// </summary>
        /// <param name="iS1">The image structure 1.</param>
        /// <param name="iS2">The image structure 2.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static ImageStructure operator -(ImageStructure iS1, ImageStructure iS2)
        {
            ImageStructure result = new ImageStructure();
            result.R = (byte)((int)iS1.R - (int)iS2.R);
            result.G = (byte)((int)iS1.G - (int)iS2.G);
            result.B = (byte)((int)iS1.B - (int)iS2.B);
            return result;
        }

        /// <summary>
        /// Implements the operator -.
        /// </summary>
        /// <param name="iS1">The image structure 1.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static ImageStructure operator +(ImageStructure iS1, double value)
        {
            ImageStructure result = new ImageStructure();
            result.R = (byte)((int)iS1.R + value);
            result.G = (byte)((int)iS1.G + value);
            result.B = (byte)((int)iS1.B + value);
            return result;
        }
    }

    /// <summary>
    /// Image with double R G B 
    /// </summary>
    public struct DoubleImage
    {
        /// <summary>
        /// red color
        /// </summary>
        public double Red;

        /// <summary>
        /// green color
        /// </summary>
        public double Green;

        /// <summary>
        /// blue color
        /// </summary>
        public double Blue;

        /// <summary>
        /// Initializes a new instance of the DoubleImage struct.
        /// </summary>
        /// <param name="r">The red.</param>
        /// <param name="g">The greed.</param>
        /// <param name="b">The blue.</param>
        public DoubleImage(double r, double g, double b)
        {
            this.Red = r;
            this.Green = g;
            this.Blue = b;
        }

        /// <summary>
        /// Implements the operator +.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="doI2">The Second double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator +(DoubleImage doI1, DoubleImage doI2)
        {
            return new DoubleImage(doI1.Red + doI2.Red, doI1.Green + doI2.Green, doI1.Blue + doI2.Blue);
        }

        /// <summary>
        /// Implements the operator +.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator +(DoubleImage doI1, double value)
        {
            return new DoubleImage(doI1.Red + value, doI1.Green + value, doI1.Blue + value);
        }

        /// <summary>
        /// Implements the operator +.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="imgst">The Second double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator +(DoubleImage doI1, ImageStructure imgst)
        {
            return new DoubleImage(doI1.Red + imgst.R, doI1.Green + imgst.G, doI1.Blue + imgst.B);
        }

        /// <summary>
        /// Implements the operator -.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="doI2">The Second double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator -(DoubleImage doI1, DoubleImage doI2)
        {
            return new DoubleImage(doI1.Red - doI2.Red, doI1.Green - doI2.Green, doI1.Blue - doI2.Blue);
        }

        /// <summary>
        /// Implements the operator -.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator -(DoubleImage doI1, double value)
        {
            return new DoubleImage(doI1.Red - value, doI1.Green - value, doI1.Blue - value);
        }

        /// <summary>
        /// Implements the operator -.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="doI1">The First double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator -(double value, DoubleImage doI1)
        {
            return new DoubleImage(value - doI1.Red, value - doI1.Green, value - doI1.Blue);
        }

        /// <summary>
        /// Implements the operator -.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="imgst">The Second double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator -(DoubleImage doI1, ImageStructure imgst)
        {
            return new DoubleImage(doI1.Red - imgst.R, doI1.Green - imgst.G, doI1.Blue - imgst.B);
        }

        /// <summary>
        /// Implements the operator *.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="doI2">The Second double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator *(DoubleImage doI1, DoubleImage doI2)
        {
            return new DoubleImage(doI1.Red * doI2.Red, doI1.Green * doI2.Green, doI1.Blue * doI2.Blue);
        }

        /// <summary>
        /// Implements the operator *.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator *(DoubleImage doI1, double value)
        {
            return new DoubleImage(doI1.Red * value, doI1.Green * value, doI1.Blue * value);
        }

        /// <summary>
        /// Implements the operator *.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="imgst">The Second double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator *(DoubleImage doI1, ImageStructure imgst)
        {
            return new DoubleImage(doI1.Red * imgst.R, doI1.Green * imgst.G, doI1.Blue * imgst.B);
        }

        /// <summary>
        /// Implements the operator /.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="doI2">The Second double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator /(DoubleImage doI1, DoubleImage doI2)
        {
            return new DoubleImage(doI1.Red / doI2.Red, doI1.Green / doI2.Green, doI1.Blue / doI2.Blue);
        }

        /// <summary>
        /// Implements the operator /.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator /(DoubleImage doI1, double value)
        {
            return new DoubleImage(doI1.Red / value, doI1.Green / value, doI1.Blue / value);
        }

        /// <summary>
        /// Implements the operator /.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="doI1">The First double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator /(double value, DoubleImage doI1)
        {
            return new DoubleImage(value / doI1.Red, value / doI1.Green, value / doI1.Blue);
        }

        /// <summary>
        /// Implements the operator /.
        /// </summary>
        /// <param name="doI1">The First double image.</param>
        /// <param name="imgst">The Second double image.</param>
        /// <returns>
        /// The result of the operator.
        /// </returns>
        public static DoubleImage operator /(DoubleImage doI1, ImageStructure imgst)
        {
            return new DoubleImage(doI1.Red / imgst.R, doI1.Green / imgst.G, doI1.Blue / imgst.B);
        }
    }

    /// <summary>
    /// Class carrying fourier image
    /// </summary>
    public class FourierImage
    {
        /// <summary>
        /// red log mag
        /// </summary>
        private double[,] redLogMagnitude = null, greenLogMagnitude = null, blueLogMagnitude = null, grayLogMagnitude = null;

        /// <summary>
        /// red mag
        /// </summary>
        private double[,] redMagnitude = null, greenMagnitude = null, blueMagnitude = null;

        /// <summary>
        /// red spatial
        /// </summary>
        private double[,] redSpatial = null, greenSpatial = null, blueSpatial = null;

        /// <summary>
        /// red image
        /// </summary>
        private double[,] redImage = null, greenImage = null, blueImage = null;

        /// <summary>
        /// real red
        /// </summary>
        private double[,] realRed = null, imagRed = null;

        /// <summary>
        /// real green
        /// </summary>
        private double[,] realGreen = null, imagGreen = null;

        /// <summary>
        /// real blue
        /// </summary>
        private double[,] realBlue = null, imagBlue = null;

        /// <summary>
        /// Matlab class obj
        /// </summary>
        private Class1 matlabClassObj;

        /// <summary>
        /// Digital image
        /// </summary>
        private DImage image;

        /// <summary>
        /// u and v integers
        /// </summary>
        private int u, v;

        /// <summary>
        /// Initializes a new instance of the <see cref="FourierImage"/> class.
        /// </summary>
        /// <param name="i">The i.</param>
        public FourierImage(DImage i)
        {
            this.image = i;
            this.u = i.Height;
            this.v = i.Width;
            this.matlabClassObj = new Class1();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FourierImage"/> class.
        /// </summary>
        public FourierImage()
        {
        }

        /// <summary>
        /// Gets or sets the red log magnitude.
        /// </summary>
        /// <value>
        /// The red log magnitude.
        /// </value>
        public double[,] RedLogMagnitude
        {
            get { return this.redLogMagnitude; }
            set { this.redLogMagnitude = value; }
        }

        /// <summary>
        /// Gets or sets the green log magnitude.
        /// </summary>
        /// <value>
        /// The green log magnitude.
        /// </value>
        public double[,] GreenLogMagnitude
        {
            get { return this.greenLogMagnitude; }
            set { this.greenLogMagnitude = value; }
        }

        /// <summary>
        /// Gets or sets the blue log magnitude.
        /// </summary>
        /// <value>
        /// The blue log magnitude.
        /// </value>
        public double[,] BlueLogMagnitude
        {
            get { return this.blueLogMagnitude; }
            set { this.blueLogMagnitude = value; }
        }

        /// <summary>
        /// Gets or sets the gray log magnitude.
        /// </summary>
        /// <value>
        /// The gray log magnitude.
        /// </value>
        public double[,] GrayLogMagnitude
        {
            get { return this.grayLogMagnitude; }
            set { this.grayLogMagnitude = value; }
        }

        /// <summary>
        /// Gets or sets the red magnitude.
        /// </summary>
        /// <value>
        /// The red magnitude.
        /// </value>
        public DImage Image
        {
            get { return this.image; }
            set { this.image = value; }
        }

        /// <summary>
        /// Gets or sets the green magnitude.
        /// </summary>
        /// <value>
        /// The green magnitude.
        /// </value>
        public int U
        {
            get { return this.u; }
            set { this.u = value; }
        }

        /// <summary>
        /// Gets or sets the blue magnitude.
        /// </summary>
        /// <value>
        /// The blue magnitude.
        /// </value>
        public int V
        {
            get { return this.v; }
            set { this.v = value; }
        }

        /// <summary>
        /// Inits this instance.
        /// </summary>
        public void Init()
        {
            FourierOperations.SeparateColors(ref this.redImage, ref this.greenImage, ref this.blueImage, this.image);
            FourierOperations.GetFourierFromMatlab(ref this.realRed, ref this.realGreen, ref this.realBlue, ref this.imagRed, ref this.imagGreen, ref this.imagBlue, this.matlabClassObj, this.redImage, this.greenImage, this.blueImage);
            FourierOperations.GetMagnitude(ref this.redMagnitude, ref this.greenMagnitude, ref this.blueMagnitude, this.realRed, this.realGreen, this.realBlue, this.imagRed, this.imagGreen, this.imagBlue);
            FourierOperations.GetLogMagnitude(ref this.redLogMagnitude, ref this.greenLogMagnitude, ref this.blueLogMagnitude, ref this.grayLogMagnitude, this.redMagnitude, this.greenMagnitude, this.blueMagnitude);

            // FourierOperations.GetSpatialFromMatlab(ref redSpatial, ref greenSpatial, ref blueSpatial, matlabClassObj, realRed, realGreen, realBlue, imagRed, imagGreen, imagBlue);
        }

        /// <summary>
        /// Gets the spatial.
        /// </summary>
        public void GetSpatial()
        {
            FourierOperations.GetSpatialFromMatlab(ref this.redSpatial, ref this.greenSpatial, ref this.blueSpatial, this.matlabClassObj, this.realRed, this.realGreen, this.realBlue, this.imagRed, this.imagGreen, this.imagBlue);
        }

        /// <summary>
        /// Inits the and return.
        /// </summary>
        /// <returns>Recollected image</returns>
        public ImageStructure[,] InitAndReturn()
        {
            FourierOperations.SeparateColors(ref this.redImage, ref this.greenImage, ref this.blueImage, this.image);
            FourierOperations.GetFourierFromMatlab(ref this.realRed, ref this.realGreen, ref this.realBlue, ref this.imagRed, ref this.imagGreen, ref this.imagBlue, this.matlabClassObj, this.redImage, this.greenImage, this.blueImage);
            FourierOperations.GetMagnitude(ref this.redMagnitude, ref this.greenMagnitude, ref this.blueMagnitude, this.realRed, this.realGreen, this.realBlue, this.imagRed, this.imagGreen, this.imagBlue);
            FourierOperations.GetLogMagnitude(ref this.redLogMagnitude, ref this.greenLogMagnitude, ref this.blueLogMagnitude, ref this.grayLogMagnitude, this.redMagnitude, this.greenMagnitude, this.blueMagnitude);
            FourierOperations.GetSpatialFromMatlab(ref this.redSpatial, ref this.greenSpatial, ref this.blueSpatial, this.matlabClassObj, this.realRed, this.realGreen, this.realBlue, this.imagRed, this.imagGreen, this.imagBlue);
            return FourierOperations.RecollectImage(this.redSpatial, this.greenSpatial, this.blueSpatial, PostProcessing.None);
        }

        /// <summary>
        /// Applies the mask on spatial.
        /// </summary>
        /// <param name="mask">The mask.</param>
        /// <returns>Applied mask</returns>
        public ImageStructure[,] ApplyMaskOnSpatial(double[,] mask)
        {
            ImageStructure[,] newImage = new ImageStructure[this.u, this.v];

            for (int i = 0; i < this.u; i++)
            {
                for (int j = 0; j < this.v; j++)
                {
                    newImage[i, j].R = Convert.ToByte(this.redImage[i, j] * mask[i, j]);
                    newImage[i, j].G = Convert.ToByte(this.greenImage[i, j] * mask[i, j]);
                    newImage[i, j].B = Convert.ToByte(this.blueImage[i, j] * mask[i, j]);
                }
            }

            return newImage;
        }

        /// <summary>
        /// Applies the mask on magnitude.
        /// </summary>
        /// <param name="mask">The mask.</param>
        /// <returns>Applied mask</returns>
        public ImageStructure[,] ApplyMaskOnMagnitude(double[,] mask)
        {
            double[,] graymag = new double[this.u, this.v];

            for (int i = 0; i < this.u; i++)
            {
                for (int j = 0; j < this.v; j++)
                {
                    graymag[i, j] = this.grayLogMagnitude[i, j] * mask[i, j];
                }
            }

            return PixelOperation.NormalizationOneColor(graymag, this.u, this.v, 'f');
        }

        /// <summary>
        /// Applies the mask on freq onthis.
        /// </summary>
        /// <param name="mask">The mask.</param>
        /// <returns>Applied mask</returns>
        public ImageStructure[,] ApplyMaskOnFreqOnthis(double[,] mask)
        {
            for (int i = 0; i < this.u; i++)
            {
                for (int j = 0; j < this.v; j++)
                {
                    this.realRed[i, j] *= mask[i, j];
                    this.realGreen[i, j] *= mask[i, j];
                    this.realBlue[i, j] *= mask[i, j];
                    this.imagRed[i, j] *= mask[i, j];
                    this.imagGreen[i, j] *= mask[i, j];
                    this.imagBlue[i, j] *= mask[i, j];
                }
            }

            this.GetSpatial();
            return FourierOperations.RecollectImage(this.redSpatial, this.greenSpatial, this.blueSpatial, PostProcessing.None);
        }

        /// <summary>
        /// Applies the mask on freq.
        /// </summary>
        /// <param name="mask">The mask.</param>
        /// <param name="postProcessing">The PP.</param>
        /// <returns>Masked frequency</returns>
        public ImageStructure[,] ApplyMaskOnFreq(double[,] mask, PostProcessing postProcessing)
        {
            double[,] rr = new double[this.u, this.v], rg = new double[this.u, this.v], rb = new double[this.u, this.v],
                ir = new double[this.u, this.v], ig = new double[this.u, this.v], ib = new double[this.u, this.v], rs = new double[this.u, this.v],
                gs = new double[this.u, this.v], bs = new double[this.u, this.v];

            for (int i = 0; i < this.u; i++)
            {
                for (int j = 0; j < this.v; j++)
                {
                    rr[i, j] = this.realRed[i, j] * mask[i, j];
                    rg[i, j] = this.realGreen[i, j] * mask[i, j];
                    rb[i, j] = this.realBlue[i, j] * mask[i, j];
                    ir[i, j] = this.imagRed[i, j] * mask[i, j];
                    ig[i, j] = this.imagGreen[i, j] * mask[i, j];
                    ib[i, j] = this.imagBlue[i, j] * mask[i, j];
                }
            }

            // FourierOperations.GetSpatialFromMatlab(ref rs, ref gs, ref bs, matlabClassObj, rr, rg, rb, ir, ig, ib);
            FourierOperations.GetSpatialFromMatlab(ref this.redSpatial, ref this.greenSpatial, ref this.blueSpatial, this.matlabClassObj, rr, rg, rb, ir, ig, ib);

            // ImageStructure[,] newimage = new ImageStructure[this.u, this.v];
            // return PixelOperation.Normalization(newimage, u, v, rs, gs, bs);
            if (postProcessing == PostProcessing.Normalization)
            {
                // return PixelOperation.Normalization(newimage, u, v, rs, gs, bs);
                return FourierOperations.RecollectImage(this.redSpatial, this.greenSpatial, this.blueSpatial, PostProcessing.Normalization);
            }
            else if (postProcessing == PostProcessing.CuttOff)
            {
                // newimage = FourierOperations.RecollectImage(rs, gs, bs);
                // newimage = PixelOperation.CutOffImage(newimage);
                // return newimage;
                return FourierOperations.RecollectImage(this.redSpatial, this.greenSpatial, this.blueSpatial, PostProcessing.CuttOff);
            }
            else
            {
                return FourierOperations.RecollectImage(this.redSpatial, this.greenSpatial, this.blueSpatial, PostProcessing.None);
            }
        }

        /// <summary>
        /// Returns the spatial image.
        /// </summary>
        /// <returns>Spatial image</returns>
        public ImageStructure[,] ReturnSpatialImage()
        {
            return FourierOperations.RecollectImage(this.redSpatial, this.greenSpatial, this.blueSpatial, PostProcessing.None);
        }
    }
}